<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
    /**
     * @author 张天兴
     * @since 2009/05/19
     */
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<title>聋校备课与语言学习及矫治系统</title>
<fmt:setBundle basename="PathResource" scope="session" />
<link href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style2.css"
	rel="stylesheet" type="text/css" />
<script  type="text/javascript">
	//alert(data);
var evaluateText;
function evaluationClick(radio,replaceText){
		evaluateText = radio.value;
		if(radio.value=="替代"){
			replaceText.disabled = !radio.checked;
			document.getElementById("content").style.display="block";
		}else{
			if(radio.checked){
				replaceText.value = "";
				replaceText.disabled = "false";
				document.getElementById("content").style.display="none";
			}
		}
	}	
</script>	

<script type="text/javascript">	
	
	var rightFrame;
		
	window.onload = function(){
		rightFrame = self.parent.frames["rightFrame"];
	}
	function submitForm1(){
		var studentId=rightFrame.getStudentID();
		var targetId=rightFrame.getTargetID();
		if(studentId==""){
			alert("请先选择要评估的学生!");			
			return;
		}
		if(targetId==""){
			alert("请先选择学习内容!");
			return;
		}
		var result = "";
		var radios = document.getElementsByName("result");
         	for(var i=0;i<radios.length;i++){
         		if(radios[i].checked){
         			result = radios[i].value;
         		}
         	}
         if(result==""){            
			alert("请先进行评估!");
			return;
		}else if(result=="替代"){
			var replaceText = document.forms[0].replaceText.value;
			if(replaceText==""){
				alert("请输入替代音!");
				document.forms[0].replaceText.focus();
				return;
			}
		}
		
		if(document.forms[0].score.value==""){            
			alert("请输入评估分数!");
			return;
		}
		if(isNaN(document.forms[0].score.value)){
			alert("分数必须是数字！");
			document.forms[0].score.select();
			return;
		}
		document.forms[0].action+="?studentID="+studentId;
		document.forms[0].submit();
	}
</script>


</head>
<body  class="left_style" bgcolor="#ccea68">
<html:form   method="post" action="studpinggu.do">
 <input type=hidden name="method" value="save" />
  <table width="203" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="700" align="center" valign="top" background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/left_bg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="80">&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><table width="196" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/mbpg/left_02.gif" width="196" height="92" /></td>
              </tr>
              <tr>
                <td height="150" align="center" valign="middle" background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/mbpg/left_03.gif">
                 <table width="90%" border="0"  cellspacing="8" cellpadding="0">
                    <tr>
                      <td colspan="2" align="center" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="center"><input type="radio" name="result" onclick="evaluationClick(this,replaceText);" id="radio" value="正确" /></td>
                          <td align="left">正确</td>
                          <td align="center"><input type="radio" name="result" onclick="evaluationClick(this,replaceText);" id="radio2" value="歪曲" /></td>
                          <td align="left">歪曲</td>
                        </tr>
                      </table></td>
                      </tr>
                    <tr>
                      <td colspan="2" align="center" valign="middle">
                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="center"><input type="radio" name="result" onclick="evaluationClick(this,replaceText);" id="radio3" value="丢失" /></td>
                          <td align="left">丢失</td>
                          <td align="center"><input type="radio" name="result" onclick="evaluationClick(this,replaceText);" id="radio4" value="替代" 	onclick="document.all.content.style.display='';"/></td>
                          <td align="left">替代</td>
                        </tr>
                      </table></td>
                      </tr>
                      
                    <tr  style="DISPLAY: none"	id="content">
                      <td colspan="2" align="right" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="40%" align="right" valign="middle">具体内容：</td>
                          <td align="left"><input name="replaceText" type="text" class="left_bor" id="content" style="width:80px;" maxlength="10"/></td>
                        </tr>
                      </table></td>
                    </tr>
                    
                    <tr>
                      <td colspan="2" align="right" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="40%" align="right" valign="middle">分 &nbsp;数：</td>
                          <td align="left"><input name="score" type="text" class="left_bor" id="textfield2" style="width:80px;" maxlength="4"/></td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle"></td>
                      <td align="center" valign="middle"><a href="javascript:submitForm1();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/save.gif" width="53" height="22" border="0" /></a></td>
                    </tr>
                    
                </table></td>
              </tr>
              <tr>
                <td><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/mbpg/left_04.gif" width="196" height="23" /></td>
              </tr>
            </table></td>
          </tr>
      </table></td>
    </tr>
  </table>
</html:form>

</body>
</html>
